<template>
  <div class="app">
    <Header />

    <main class="main-content">
      <NuxtLayout>
        <NuxtPage />
      </NuxtLayout>
    </main>

    <!-- 音乐播放器 -->
    <MusicPlayer />
  </div>
</template>

<script setup>
import { usePageVisibility } from '~/utils/visibility'

// 页面可见性状态
const { isVisible } = usePageVisibility()

// 动态标题
const dynamicTitle = computed(() => {
  return isVisible.value ? 'QA Blog' : '👀 快回来看看！'
})

// 设置页面标题
useHead({
  title: dynamicTitle,
})
</script>

<style scoped>
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding-top: 0;
}
</style>
